ghacks-clear-57-[changes-only].js 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /***
  2. For instructions see:
  3. https://github.com/ghacksuserjs/ghacks-user.js/wiki/3.1-Resetting-Inactive-Prefs-[Scripts]
  4. ***/
  5. (function() {
  6. let ops = [
  7. /* --- 57-alpha --- */
  8. /* commented out */
  9. 'browser.storageManager.enabled',
  10. 'dom.storageManager.enabled',
  11. /* removed from the user.js */
  12. 'browser.search.geoip.timeout',
  13. 'geo.wifi.xhr.timeout',
  14. 'gfx.layerscope.enabled',
  15. 'media.webspeech.recognition.enable',
  16. /* moved to RFP ALTERNATIVES */
  17. 'dom.w3c_touch_events.enabled',
  18. 'media.video_stats.enabled',
  19. /* moved to DEPRECATED/REMOVED */
  20. 'browser.bookmarks.showRecentlyBookmarked',
  21. 'browser.casting.enabled',
  22. 'devtools.webide.autoinstallFxdtAdapters',
  23. 'media.eme.chromium-api.enabled',
  24. 'social.directories',
  25. 'social.enabled',
  26. 'social.remote-install.enabled',
  27. 'social.share.activationPanelEnabled',
  28. 'social.shareDirectory',
  29. 'social.toast-notifications.enabled',
  30. 'social.whitelist',
  31. /* reset parrot: check your open about:config after running the script */
  32. '_user.js.parrot'
  33. ]
  34. if("undefined" === typeof(Services)) {
  35. alert("about:config needs to be the active tab!");
  36. return;
  37. }
  38. let c = 0;
  39. for (let i = 0, len = ops.length; i < len; i++) {
  40. if (Services.prefs.prefHasUserValue(ops[i])) {
  41. Services.prefs.clearUserPref(ops[i]);
  42. if (!Services.prefs.prefHasUserValue(ops[i])) {
  43. console.log("reset", ops[i]);
  44. c++;
  45. } else { console.log("failed to reset", ops[i]); }
  46. }
  47. }
  48. focus();
  49. let d = (c==1) ? " pref" : " prefs";
  50. if (c > 0) {
  51. alert("successfully reset " + c + d + "\n\nfor details check the Browser Console (Ctrl+Shift+J)");
  52. } else { alert("nothing to reset"); }
  53. })();